cmake_minimum_required(VERSION 2.6)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)

project(atomic)

# find library
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

if (WINDOWS)
add_definitions(-D__WINDOWS__)
add_definitions(-D_WIN32_WINNT=0x0501)
add_definitions(-D_CRTDBG_MAP_ALLOC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
else ()
add_definitions(-D__LINUX__)
	if (CMAKE_COMPILER_IS_GNUCXX)
	add_definitions(-std=gnu++0x)
	else ()
	add_definitions(-std=stdc++11)
	endif()
endif()

set(atomic_SOURCES
	Common.h
	Common.cpp
	Main.cpp
)

if (WINDOWS)
include_directories( 
	"${PROJECT_SOURCE_DIR}/../"
	"${PROJECT_SOURCE_DIR}/../deps/dev"
)
else ()
include_directories(
	"${PROJECT_SOURCE_DIR}/../"
	"${PROJECT_SOURCE_DIR}/../deps/dev"
)
endif()

add_executable(atomic ${atomic_SOURCES})
target_link_libraries(atomic dev boost_program_options)
if (WINDOWS)
target_link_libraries(atomic ws2_32)
else ()
target_link_libraries(atomic pthread rt)
endif()
